package com.edu.control.deploy;

import com.edu.control.deploy.constant.DeployStatus;

import java.io.Serializable;

public class DeployResult implements Serializable {

    public DeployResult() {
    }

    public DeployResult(DeployStatus deployStatus) {
        this.code = deployStatus.getCode();
        this.title = deployStatus.getTitle();
    }

    private int code = DeployStatus.SUCCESS.getCode();

    private String title;

    private String msg;

    private PodResult podResult;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public PodResult getPodResult() {
        return podResult;
    }

    public void setPodResult(PodResult podResult) {
        this.podResult = podResult;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static DeployResult newDeployResult(DeployStatus deployStatus) {
        return new DeployResult(deployStatus);
    }

    @Override
    public String toString() {
        return "DeployResult{" +
                "code=" + code +
                ", title='" + title + '\'' +
                ", msg='" + msg + '\'' +
                ", podResult=" + podResult +
                '}';
    }
}
